﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    public partial class search_whd : FormBase1
    {
        public search_whd()
        {
            InitializeComponent();
        }

        private void search_whd_Load(object sender, EventArgs e)
        {
            dateselect1.lue_date.Properties.DataSource = my.dts;
            dateselect1.lue_date.EditValue = 0;
        }

        private void btn_search_Click(object sender, EventArgs e)
        {
            if (!dvp.Validate()) return;
            if (dateselect1.de_sd.EditValue == null || dateselect1.de_ed.EditValue == null)
            {
                Comm.ShowAlert("请指定提取数据的日期范围！");
                return;
            }
            else
            {
                gridControl1.DataSource = my.bw.get_whd_View_all_bydateResult(int.Parse(radioGroup1.EditValue.ToString()), dateselect1.de_sd.DateTime, dateselect1.de_ed.DateTime, my.ACID);
                gridView1.BestFitColumns();
            }

        }

        private void btn_print_Click(object sender, EventArgs e)
        {
            gridControl1.ShowPrintPreview();
        }
    }
}